package edu.stu.cs.software.family.producer.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.stu.cs.software.family.base.domain.BaseTreeEntity;

/**
 * 
 * @author guo_jing
 *
 */
@Table(name = "O_PRODUCER_SHOP")
@Entity
@NamedQueries({ @NamedQuery(name = "Shop.getRoot", query = "select g from Shop g where g.parent is null") })
public class Shop extends BaseTreeEntity<Shop, Long>{
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Column(name = "ADDRESS")
	String address;
	@Column(name = "PHONE")
	String Phone;
	@Column(name = "SHOPNAME")
	String shopName;
	
	@OneToMany(mappedBy = "shop", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	Set<Producer> producers;

	

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return Phone;
	}

	public void setPhone(String phone) {
		Phone = phone;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}


}